
package Display;

import java.awt.*;

import javax.swing.*;

public class LeftDisplay extends JPanel {
	private JPanel panel;
	
	public LeftDisplay() {
		setLayout(new BorderLayout());
		
		panel = new JPanel();
	//	panel.setBackground(Color.BLUE);
		panel.setLayout(new BorderLayout());
		
		JSeparator separatorNorth = new JSeparator(JSeparator.HORIZONTAL);
		separatorNorth.setBackground(Color.DARK_GRAY);
		panel.add(separatorNorth, BorderLayout.NORTH);
		
		JSeparator separatorSouth = new JSeparator(JSeparator.HORIZONTAL);
		separatorSouth.setBackground(Color.DARK_GRAY);
		panel.add(separatorSouth, BorderLayout.SOUTH);
		
		JSeparator separatorWest = new JSeparator(JSeparator.VERTICAL);
		separatorWest.setBackground(Color.DARK_GRAY);
		panel.add(separatorWest, BorderLayout.WEST);
		
		JSeparator separatorEast = new JSeparator(JSeparator.VERTICAL);
		separatorEast.setBackground(Color.DARK_GRAY);
		panel.add(separatorEast, BorderLayout.EAST);
		
		add(panel);
		
	//	setVisible(true);
	//	validate();
	}
	
	public LeftDisplay(Component component) {
		setLayout(new BorderLayout());
		
		panel = new JPanel();
	//	panel.setBackground(Color.BLUE);
		panel.setLayout(new BorderLayout());
		
		JSeparator separatorNorth = new JSeparator(JSeparator.HORIZONTAL);
		separatorNorth.setBackground(Color.DARK_GRAY);
		panel.add(separatorNorth, BorderLayout.NORTH);
		
		JSeparator separatorSouth = new JSeparator(JSeparator.HORIZONTAL);
		separatorSouth.setBackground(Color.DARK_GRAY);
		panel.add(separatorSouth, BorderLayout.SOUTH);
		
		JSeparator separatorWest = new JSeparator(JSeparator.VERTICAL);
		separatorWest.setBackground(Color.DARK_GRAY);
		panel.add(separatorWest, BorderLayout.WEST);
		
		JSeparator separatorEast = new JSeparator(JSeparator.VERTICAL);
		separatorEast.setBackground(Color.DARK_GRAY);
		panel.add(separatorEast, BorderLayout.EAST);
		
		panel.add(component, BorderLayout.CENTER);
		add(panel);
		
		
	//	setVisible(true);
	//	validate();
	}
	
	public void setLeftDisplay(Object object) {
		this.panel = (JPanel) object;
	}
	
	public void addObject(Component component) {
		panel.add(component, BorderLayout.CENTER);
		this.validate();
	}
}
